package cn.com.wdjedu.androidapp.wjeduandroid.support.lib.mvputils;


import rx.Observable;
import rx.Subscriber;

/**
 * RXjava的帮助类
 */
public class RxHelperUtils {


    //创建成功的数据
    private static <T> Observable<T> createData(final T data) {
        return Observable.create(new Observable.OnSubscribe<T>() {
            @Override
            public void call(Subscriber<? super T> subscriber) {
                try {
                    subscriber.onNext(data);
                    subscriber.onCompleted();
                } catch (Exception e) {
                    subscriber.onError(e);
                }
            }
        });
    }
}
